package com.wz.config;

import com.wz.pojo.USDT;
import org.web3j.protocol.Web3j;
import org.web3j.protocol.http.HttpService;
import rx.Observable;

/**
 * @program: demo
 * @description:
 * @author: Wangzheng
 * @create: 2020-12-23 21:00
 **/
public class test {
	Web3j web3j = Web3j.build(new HttpService(Normal.SERVER));


	public static void main(String[] args) {

		Web3j web3j = Web3j.build(new HttpService(Normal.SERVER));
		Observable<USDT.TransferEventResponse> transferEventResponseObservable = new USDTapi().transferEventOb();
		transferEventResponseObservable.subscribe((tx)->{
			System.out.println(tx.value);
			System.out.println(tx.from);
			System.out.println(tx.to);
			System.out.println(tx.log.getData());
			System.out.println(tx.log.getTopics());
			System.out.println(tx.log.getTransactionHash());
			System.out.println(tx.log.getAddress());//合约地址
			System.out.println(tx.log.getBlockHash());
			System.out.println(tx.log.getBlockNumber());
		});
	}

}